<template>
	<view class="content">
		<view class="uni-list" hover-class="uni-list-cell-hover">
			<view class="uni-media-list">
				<image class="uni-media-list-logo" :src="newsImage"></image>
				<view class="uni-media-list-body">
					<view class="uni-media-list-text-top">{{newsTitle}}</view>
					<view class="uni-media-list-text-bottom uni-ellipsis">{{newsCreatTime}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'ui-newsList',
		props: {
			newsImage: '',
			newsTitle: '',
			newsCreatTime: ''
		}
	}
</script>

<style lang="scss" scoped>
	// H5默认启用了scoped,非H5端默认并未启用scoped;
	// 界面被scoped局部化之后，不能覆盖界面里面的子组件样式，因为样式只对当前界面生效。（可以加/deep/解决）
	.uni-list {
		background-color: #FFFFFF;
		position: relative;
		width: 100%;
		display: flex;
		flex-direction: column;
	}

	.uni-list-cell-hover {
		background-color: #eee;
	}

	.uni-media-list {
		padding: 22upx 30upx;
		box-sizing: border-box;
		display: flex;
		width: 100%;
		flex-direction: row;
	}

	.uni-media-list-logo {
		height: 84upx;
		width: 84upx;
		margin-right: 20upx;
	}

	.uni-media-list-body {
		height: 84upx;
		display: flex;
		flex: 1;
		flex-direction: column;
		justify-content: space-between;
		align-items: flex-start;
		overflow: hidden;
	}

	.uni-media-list-text-top {
		width: 100%;
		line-height: 36upx;
		font-size: 30upx;
	}

	.uni-media-list-text-bottom {
		width: 100%;
		line-height: 30upx;
		font-size: 26upx;
		color: #8f8f94;
	}

	/* 文本溢出隐藏 */
	.uni-ellipsis {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.uni-media-list-body {
		height: auto;
	}

	.uni-media-list-text-bottom {
		margin-top: 16upx;
	}
</style>
